package com.example.netty.service.communication;

import com.example.netty.common.FluxQuery;
import com.example.netty.pojo.Communication;
import com.influxdb.client.InfluxDBClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CommunicationServiceImpl {
    @Autowired
    InfluxDBClient influxDBClient;


    public boolean isExist(String bucketName){
        return FluxQuery.newFindOne(influxDBClient,bucketName,"-30s","Communication", Communication.class)==null?false:true;
    }
}
